package com.orkasgb.framework.orkasgbframework.paymentmode;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/payment")
public class PaymentModeController {

    @Autowired(required = false)
    private PaymentFactory paymentFactory;

    @PostMapping("/pay")
    public String pay(@RequestParam String  paymentMode) {
        return paymentFactory.getPaymentMode(paymentMode).pay();
    }

}
